package com.qiche.service2.impl;

import com.qiche.mapper2.Store2Mapper;
import com.qiche.model.Store2;
import com.qiche.service.impl.BaseService;
import com.qiche.service2.Store2Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import tk.mybatis.mapper.entity.Example;

import java.util.List;

/**
 * @author chendezhi
 * @date 2018/3/28 19:39
 */
@Service
public class Store2ServiceImpl extends BaseService<Store2> implements Store2Service {

    @Autowired
    private Store2Mapper store2Mapper;
    @Override
    public List<Store2> selectByIds(List<Long> ids) {
        Example example = new Example(Store2.class);
        Example.Criteria criteria = example.createCriteria();
        criteria.andIn("id",ids);
        return mapper.selectByExample(example);
    }

    @Override
    public List<Store2> selectByRegionCode(String useRegion) {
        Example example = new Example(Store2.class);
        Example.Criteria criteria = example.createCriteria();
        criteria.andEqualTo("regionCode",useRegion);
        return mapper.selectByExample(example);
    }
}
